package com.hyfrogx.modules.operation.service.umeng;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hyfrogx.common.utils.QueryExt;
import com.hyfrogx.modules.operation.entity.HyAppPushEntity;
import com.hyfrogx.modules.zoom.entity.HyZoomMeeting;

/**
 * @author liubin
 */
public interface UmengService extends IService<HyAppPushEntity> {
	
	String name = "umengService.name";

	/**用户登录时添加deviceToken
	 * @param uid
	 * @param device_token
	 */
	void addDeviceToken(Integer uid, String device_token);

	/**定时任务存储
	 * @throws Exception
	 */
	void saveUserDeviceToken() throws Exception;

	/**
	 * 安卓群发广播
	 * @param appPush
	 * @throws Exception
	 */
	boolean sendAndroidBroadcast(HyAppPushEntity appPush)throws Exception;


	/**
	 * 苹果群发广播
	 * @param appPush
	 */
	boolean sendIOSBroadcast(HyAppPushEntity appPush)throws Exception;


	/**
	 *
	 * 分页查询推送历史记录
	 * @param query
	 * @return
	 * @throws Exception
	 */
	Page getAppPushRecordByPage(QueryExt query) throws Exception;


	/**
	 * 单推
	 * @param appPush
	 */
	boolean sendSingleBroadcast(HyAppPushEntity appPush) throws Exception;
	
	/**
	 * 单推
	 * 2018.9.5修改单推DisplayType为message
	 * @param appPush
	 */
	boolean sendSingleMessage(HyAppPushEntity appPush) throws Exception;
	

	
	/**
	 * 启动就加载用户的device_token
	 */
	void init();


	/**
	 * 取消推送任务
	 * @param id
	 */
	void cancleBroadcast(Integer id) throws Exception;


	/**
	 * @param id
	 */
	void checkBroadcastStatus(Integer id) throws Exception;



	/**
	 * 根据ID获得推送的详情
	 * @param id
	 * @return
	 */
	HyAppPushEntity getAppPushById(Integer id) throws Exception;

	/**
	 * 客户端获取消息列表
	 * @param query
	 * @return
	 */
	Page selectMessageByPage(QueryExt query);

	/**
	 * 会议即将结束时单推
	 * 2019-1-9 17:29:18
	 * @param appPush
	 */
	public boolean singleBroadcastByMeetWillEnd(HyAppPushEntity appPush) throws Exception;


	/**
	 * 会议结束时推送反馈视窗
	 * @param meeting
	 * @param uid
	 */
	boolean sendEndMeet(HyZoomMeeting meeting, Long uid) throws Exception;

	/**
	 * 好友申请推送
	 * @param uid
	 */
	boolean applyFriend(Long uid);

	/**
	 * 成功添加好友响应推送
	 * @param uid
	 * @param toAccount 同意人的id签名
	 */
	boolean estRelation(Long uid, String toAccount);

	/**
	 * 完成任务积分推送
	 */
	public void coinPush(Long uid,Integer coin,Integer code) throws Exception;

	/**
	 * 被禁用时单推
	 * 2018-11-9 14:38:20
	 * @param appPush
	 */
	public boolean singleBroadcastByBan(HyAppPushEntity appPush) throws Exception;

}
